package com.gitee.yusugar.core.task.pojo;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * @author Y.sugar
 * @since 2023/7/24 17:43
 */
@Getter
public class TimerInfo implements Serializable {

    /* 年 */
    private List<Integer> years;

    /* 月 */
    private List<Integer> months;

    /* 天 */
    private List<Integer> days;

    /* 小时 */
    private List<Integer> hours;

    /* 分钟 */
    private List<Integer> minutes;

    /* 秒 */
    private List<Integer> seconds;

    /* 周 */
    private List<Integer> weeks;

    public void setVal(List<Integer> dateStrList, int type){
        switch (type) {
            case 0:
                years = dateStrList;
                break;
            case 1:
                months = dateStrList;
                break;
            case 2:
                days = dateStrList;
                break;
            case 3:
                hours = dateStrList;
                break;
            case 4:
                minutes = dateStrList;
                break;
            case 5:
                seconds = dateStrList;
                break;
            case 6:
                weeks = dateStrList;
                break;
        }
    }
}
